/*----------------------------------------------------------------------------------------
*
*  Copyright 2019, Gao Hai Hui, <fromzeropoint@126.com>.  All rights reserved.
*  https://gitee.com/helloworldghh/xoskit.git
*  Use of this source code is governed by a MIT license
*  that can be found in the License file.
*
----------------------------------------------------------------------------------------*/
#ifndef __517CC770_F79C_435e_9774_08F9220B5AD6__
#define __517CC770_F79C_435e_9774_08F9220B5AD6__

#include "../tools/head.h"

/////////////////////////////////////////////////////////////////////////////////////////
// 

namespace xos_aio
{
    class aio_impl;

    class aio_epoll_notify
    {
    public:
        aio_epoll_notify( aio_impl * pAioImpl );
        ~aio_epoll_notify();

    protected:
        aio_impl * m_pAioImpl;

        // 
        // 0 : read; 1 : write
        // 
        int m_nPipe[2];

    public:
        // 
        // process user request. 
        // 
        int notify( xos_box::i_msg *& lpMsg );

        // 
        // cause epoll_wait ret.
        // 
        int set_event();

        // 
        // clear data.
        // 
        int reset();

        // 
        // int ,term
        // 
        int init();
        int term();

    };
} // xos_aio

#endif // __517CC770_F79C_435e_9774_08F9220B5AD6__
